#nullable enable

using System;
using System.Collections.Generic;
using PHMEE.Diagnosis;

namespace PHMEE.DTOS.Diagnosis;

/// <summary>
/// 故障诊断振动分析报告
/// </summary>
public sealed class AlarmDiagReportDto
{
    /// <summary>
    /// 报警的测点 Id
    /// </summary>
    public Guid PointId { get; set; }

    /// <summary>
    /// 机组名称（当测点关联到设备上时，是设备名称）
    /// </summary>
    public string Unit { get; set; } = null!;

    // /// <summary>
    // /// 机组设备参数
    // /// </summary>
    // public IEnumerable<EquipParametersDto> Parameters { get; set; } = [];

    /// <summary>
    /// 报警信息
    /// </summary>
    public AlarmInfoDto AlarmInfo { get; set; } = null!;

    /// <summary>
    /// 报警特征值
    /// </summary>
    public IEnumerable<AlarmFeatureValue> AlarmFeatureValues { get; set; } = [];

    /// <summary>
    /// 诊断结论及建议
    /// </summary>
    public IEnumerable<MaintenanceInfoDto> MaintenanceInfos { get; set; } = [];

    /// <summary>
    /// 图谱分析开始时间 Utc（含）
    /// </summary>
    public DateTime SpectralAnalysisStartTimeUtc { get; set; }

    /// <summary>
    /// 图谱分析结束时间 Utc（含）
    /// </summary>
    public DateTime SpectralAnalysisEndTimeUtc { get; set; }
}

public sealed class EquipParametersDto
{
    /// <summary>
    /// 设备名称
    /// </summary>
    public string EquipName { get; set; } = null!;

    /// <summary>
    /// 参数 (名称, 值)
    /// </summary>
    public Dictionary<string, string> Parameters { get; set; } = [];
}

public sealed class AlarmInfoDto
{
    /// <summary>
    /// 测点名称
    /// </summary>
    public string PointName { get; set; } = null!;

    /// <summary>
    /// 报警时间
    /// </summary>
    public DateTime AlarmTimeUtc { get; set; }

    /// <summary>
    /// 报警测点和报警等级
    /// </summary>
    public IEnumerable<FeatureAlarmLevelsDto> FeatureAlarmLevels { get; set; } = [];
}